﻿namespace LinkedTU.Models
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using LinkedTU.Common.Constants;
    using LinkedTU.Common.Interfaces;

    public class Country : IClassificator
    {
        private ICollection<City> cities;

        public Country()
        {
            this.cities = new HashSet<City>();
        }

        public int CountryId { get; set; }

        [Required]
        [MinLength(ValidationConstants.MinCountryCodeLength)]
        [MaxLength(ValidationConstants.MaxCountryCodeLength)]
        public string CountryCode { get; set; }

        [Required]
        [MinLength(ValidationConstants.MinCountryNameLength)]
        [MaxLength(ValidationConstants.MaxCountryNameLength)]
        public string DisplayName { get; set; }

        public int Order { get; set; }

        public virtual ICollection<City> Ciies
        {
            get { return this.cities; }
            set { this.cities = value; }
        }
    }
}
